const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  // transpileDependencies: true,
  publicPath: process.env.NODE_ENV === 'production'
    ? '/byshop'
    : '/',
  chainWebpack: config => {
    config.plugin('html').tap(options => {
      options[0].title = "Shopping商城"
      return options
    })
  },
  devServer: {
    host: 'localhost',
    port: '7000',
    https: false,
    open: true,
    // 跨域
    proxy: {
      "/byapi": {
        target: "http://192.168.10.98:1024/api",
        changeOrigin: true,//允许跨域
        pathRewrite: {
          '^/byapi': ''
        },
        ws: true
      }
    }
    // devServer 打包的时候全部失效
  }
})
